<?php
if(file_exists("show.html") && time()-filemtime('show.html')<60*5)
{
    echo "静态化页面";
    include_once 'show.html';

}
else
{

ob_start();//开启
$dbh = new PDO('mysql:host=127.0.0.1;dbname=1705phpa', 'root', 'root');
$dbh->exec("set names utf8");
$sql="select * from used";
$res=$dbh->query($sql);
$data=$res->fetchAll(2);

?>
<!DOCTYPE html>
<html lang="en">
<body>
<div class="container">
    <table class="table" >
        <thead>
        <tr>
            <td>编号</td>
            <td>姓名</td>
            <td>联系方式</td>
            <td>邮箱</td>
            <td>状态</td>
        </tr>
        </thead>
        <tbody>
        <?php
        foreach($data as $k=>$v)
        {
            echo "<tr><td>$v[u_id]</td><td>$v[u_name]</td><td>$v[u_pwd]</td><td>$v[u_tell]</td><td>$v[u_email]</td></tr>";
        }

        ?>
        </tbody>
    </table>
</div>
</body>
</html>
<?php
file_put_contents('show.html',ob_get_contents());

}
?>
